package javaCode.chapter09.static_;

public class StaticDetail {
    public static void main(String[] args) {

        B b = new B();
        //System.out.println(B.n1); //实例变量不能通过 类名.类变量名 方式访问
        System.out.println(B.n2);

        //静态变量是类加载的时候，就创建了，所以我们没有创建对象 也可以通过 类名.类变量名来访问
        System.out.println(C.address);
    }
}

class B{
    public int n1 = 10;
    public static int n2 = 20;
}

class C{
    public static String address = "上海";
}
